<?php
$form = $this->beginWidget('CActiveForm', array(
    'id' => 'price-form',
        ));
?>

<div class="modal-header">
    <?php echo CHtml::link('&times;', '#', array('class' => 'close', 'data-dismiss' => 'modal')); ?>
    <h3>Price Entry Form</h3>
</div>

<div class="modal-body">
    <?php if (Yii::app()->user->hasFlash('success')): ?>
        <div class="alert alert-success">
            <?php echo Yii::app()->user->getFlash('success'); ?>
        </div>
    <?php endif; ?>

    <?php echo $form->errorSummary($model, null, null, array('class' => 'alert alert-error')); ?>

    <div class="control-group">
        <?php echo $form->labelEx($model, 'crop_id', array('class' => 'control-label')); ?>
        <div class="controls">
            <?php echo $form->dropDownList($model, 'crop_id', CHtml::listData(Crop::model()->findAll(), 'id', 'alias')); ?>
        </div>
    </div>
    <div class="control-group">
        <?php echo $form->labelEx($model, 'value', array('class' => 'control-label')); ?>
        <div class="controls">
            <?php echo $form->textField($model, 'value', array('class' => 'input-small', 'size' => 50, 'maxlength' => 50)); ?>
        </div>
    </div>
    <div class="control-group">
        <?php echo $form->labelEx($model, 'effective_datetime', array('class' => 'control-label')); ?>
        <div class="controls">
            <?php
            $this->widget('zii.widgets.jui.CJuiDatePicker', array(
                'name' => 'alt_temp_effective_date',
                'options' => array(
                    'altField' => '#Price_temp_effective_date',
                    'altFormat' => 'yy-mm-dd',
                    'dateFormat' => 'MM dd, yy',
                    'showButtonPanel' => true,
                ),
                'htmlOptions' => array(
                    'placeholder' => 'January 1, 2012',
                ),
            ));
            ?>

            <?php echo $form->hiddenField($model, 'temp_effective_date'); ?>

            <?php
            $this->widget('application.extensions.juitimepicker.JuiTimePicker', array(
                'attribute' => 'temp_effective_time',
                'model' => $model,
                'options' => array(
                    'showPeriod' => true,
                    'showCloseButton' => true,
                    'showNowButton' => true,
                ),
                'htmlOptions' => array(
                    'placeholder' => '11:45 AM',
                ),
            ));
            ?>
        </div>
    </div>
</div>

<div class="modal-footer">
    <?php echo CHtml::htmlButton($model->isNewRecord ? 'Create' : 'Save', array('class' => 'btn btn-primary', 'type' => 'submit')); ?>
</div>
<?php $this->endWidget(); ?>